<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>信阳学院 - 实验报告管理系统</title>
    <meta name="description" content="信阳学院实验报告管理系统">
    <!-- 引入基础样式 -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link rel="shortcut icon" href="../static/favicon.ico" th:href="@{favicon.ico}"/>

    <style type="text/css">
        /* 全局样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
            background-color: #f5f7fa;
            color: #333;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 20px;
        }

        /* 主体内容 */
        .main-container {
            max-width: 900px;
            margin: 0 auto;
        }

        .login-box {
            display: flex;
            background: #fff;
            border-radius: 10px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.08);
            overflow: hidden;
            width: 100%;
        }

        /* 左侧宣传区 */
        .login-banner {
            flex: 1;
            background: linear-gradient(135deg, #2c5364 0%, #203a43 100%);
            color: #fff;
            padding: 60px 40px;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .banner-title {
            font-size: 28px;
            margin-bottom: 20px;
            font-weight: 600;
        }

        .banner-desc {
            font-size: 16px;
            line-height: 1.6;
            margin-bottom: 30px;
            opacity: 0.9;
        }

        .feature-list {
            list-style: none;
        }

        .feature-item {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
            font-size: 14px;
        }

        .feature-item i {
            font-size: 20px;
            margin-right: 10px;
            color: #34d399;
        }

        /* 右侧登录区 */
        .login-form {
            flex: 1;
            padding: 60px 40px;
        }

        .form-title {
            font-size: 24px;
            color: #2c3e50;
            margin-bottom: 5px;
        }

        .form-subtitle {
            color: #666;
            margin-bottom: 30px;
            font-size: 14px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-label {
            display: block;
            margin-bottom: 8px;
            font-size: 14px;
            color: #333;
            font-weight: 500;
        }

        .form-control {
            width: 100%;
            padding: 12px 15px;
            border: 1px solid #e1e5e9;
            border-radius: 6px;
            font-size: 14px;
            transition: all 0.3s;
        }

        .form-control:focus {
            border-color: #3498db;
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
            outline: none;
        }

        /* 验证码区域 - 调整为水平对齐 */
        .captcha-group {
            display: flex;
            align-items: flex-end;
            gap: 15px;
        }

        .captcha-input {
            flex: 1;
        }

        .captcha-img-container {
            display: flex;
            align-items: flex-end;
        }

        .captcha-img {
            width: 120px;
            height: 44px;
            border-radius: 6px;
            cursor: pointer;
            object-fit: cover;
            border: 1px solid #e1e5e9;
        }

        .remember-group {
            display: flex;
            align-items: center;
            margin-bottom: 25px;
            font-size: 14px;
        }

        .remember-group input {
            margin-right: 8px;
        }

        .remember-group label {
            color: #666;
            cursor: pointer;
        }

        .btn-login {
            width: 100%;
            padding: 12px;
            background-color: #3498db;
            color: #fff;
            border: none;
            border-radius: 6px;
            font-size: 16px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .btn-login:hover {
            background-color: #2980b9;
        }

        .helper-links {
            display: flex;
            justify-content: space-between;
            margin-top: 20px;
            font-size: 14px;
        }

        .helper-links a {
            color: #3498db;
            text-decoration: none;
        }

        .helper-links a:hover {
            text-decoration: underline;
        }

        /* 页脚 */
        .footer {
            text-align: center;
            padding: 20px;
            font-size: 13px;
            color: #999;
            margin-top: 40px;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .login-box {
                flex-direction: column;
            }

            .login-banner {
                padding: 40px 20px;
                text-align: center;
            }

            .feature-item {
                justify-content: center;
            }

            .login-form {
                padding: 40px 20px;
            }

            /* 移动端验证码布局调整 */
            .captcha-group {
                flex-direction: column;
                align-items: stretch;
                gap: 10px;
            }

            .captcha-img-container {
                width: 100%;
            }

            .captcha-img {
                width: 100%;
                max-width: 120px;
            }
        }

        /* 动画效果 */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .login-box {
            animation: fadeInUp 0.5s ease-out;
        }

        .form-control:focus {
            transform: translateY(-2px);
        }
    </style>
</head>
<body>
<!-- 主体内容 -->
<main class="main-container">
    <div class="login-box">
        <!-- 左侧宣传区 -->
        <div class="login-banner">
            <h2 class="banner-title">实验报告管理系统</h2>
            <p class="banner-desc">
                为师生提供便捷高效的实验报告提交、批改、管理一体化服务，
                助力教育教学数字化转型。
            </p>
            <ul class="feature-list">
                <li class="feature-item">
                    <i class="fa fa-file-text-o"></i>
                    <span>在线提交实验报告，告别纸质文档</span>
                </li>
                <li class="feature-item">
                    <i class="fa fa-check-square-o"></i>
                    <span>教师在线批改，实时反馈评价</span>
                </li>
                <li class="feature-item">
                    <i class="fa fa-shield"></i>
                    <span>数据安全存储，权限精细管控</span>
                </li>
            </ul>
        </div>

        <!-- 右侧登录区 -->
        <div class="login-form">
            <h3 class="form-title">用户登录</h3>
            <p class="form-subtitle">欢迎使用信阳学院实验报告管理系统</p>

            <form id="signupForm" autocomplete="off">
                <div class="form-group">
                    <label class="form-label" for="username">用户名/学号/工号</label>
                    <input type="text" id="username" name="username" class="form-control" placeholder="请输入用户名/学号/工号" required>
                </div>

                <div class="form-group">
                    <label class="form-label" for="password">密码</label>
                    <input type="password" id="password" name="password" class="form-control" placeholder="请输入密码" required>
                </div>

                <div th:if="${captchaEnabled==true}" class="form-group captcha-group">
                    <div class="captcha-input">
                        <label class="form-label" for="validateCode">验证码</label>
                        <input type="text" id="validateCode" name="validateCode" class="form-control" placeholder="请输入验证码" maxlength="5" required>
                    </div>
                    <div class="captcha-img-container">
                        <img th:src="@{/captcha/captchaImage(type=${captchaType})}" class="captcha-img" title="点击更换验证码">
                    </div>
                </div>

                <div class="remember-group" th:if="${isRemembered}">
                    <input type="checkbox" id="rememberme" name="rememberme">
                    <label for="rememberme">记住登录状态</label>
                </div>

                <button type="submit" class="btn-login" id="btnSubmit">
                    <i class="fa fa-sign-in"></i> 登录系统
                </button>

                <div class="helper-links">
                    <a th:href="@{/register}" th:if="${isAllowRegister}">注册账号</a>
                    <a href="#">忘记密码？</a>
                </div>
            </form>
        </div>
    </div>
</main>

<!-- 页脚 -->
<footer class="footer">
    <p>信阳学院 © 2018-2025 版权所有</p>
</footer>

<!-- JavaScript -->
<script th:inline="javascript"> var ctx = [[@{/}]]; var captchaType = [[${captchaType}]]; var captchaEnabled = [[${captchaEnabled}]];</script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js"></script>
<script src="../static/ajax/libs/validate/jquery.validate.min.js" th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=4.8.1}"></script>
<script src="../static/ruoyi/login.js" th:src="@{/ruoyi/login.js}"></script>

<script>
    // 验证码图片点击刷新
    $(document).on('click', '.captcha-img', function() {
        $(this).attr('src', ctx + 'captcha/captchaImage?type=' + captchaType + '&timestamp=' + new Date().getTime());
    });

    // 登录表单提交处理
    $('#signupForm').submit(function(e) {
        e.preventDefault();
        // 这里可以添加登录验证逻辑
        $('#btnSubmit').prop('disabled', true).html('<i class="fa fa-spinner fa-spin"></i> 登录中...');

        // 模拟登录请求
        setTimeout(function() {
            $('#btnSubmit').prop('disabled', false).html('<i class="fa fa-sign-in"></i> 登录系统');
        }, 1500);
    });

    // 防止嵌套框架
    if(window.top!==window.self){
        alert('未登录或登录超时。请重新登录');
        window.top.location=window.location
    };
</script>
</body>
</html>